<?php
use think\facade\Route;
use api\app\middleware\CheckToken;

// 注册路由
Route::post('register','api/app/User/register');
// 登录路由
Route::post('login','api/app/User/login');
// 发送验证码路由
Route::post('sendCode','api/app/User/sendCode');
// 展示个人信息
Route::get('showUser','api/app/User/showUser');
// 修改信息
Route::post('editUser','api/app/User/editUser');
// 上传头像
Route::post('pushImage','api/app/User/pushImage');

// 查询轮播图和小按钮路由
Route::group('Banner',function () {
    // 查询轮播图
    Route::get('indexBanner', 'app/Banner/indexBanner');
});
// 查询小按钮路由
Route::group('Buttons',function () {
    // 查询小按钮
    Route::get('indexButtons', 'app/Buttons/indexButtons');
});

// 收货地址
Route::group('Address',function () {
    // 查询
    Route::get('indexAddress', 'app/Address/indexAddress');
    // 添加
    Route::post('addAddress', 'app/Address/addAddress');
    // 编辑
    Route::post('editAddress', 'app/Address/editAddress');
    // 删除
    Route::post('deleteAddress', 'app/Address/deleteAddress');
})->middleware(CheckToken::class);

// 金钱
Route::group('money',function () {
    // 充值
    Route::post('addMoney', 'app/Wallet/addMoney');
    Route::post('moneyReport', 'app/Wallet/moneyReport');
});

// 支付
Route::group('order',function (){
    Route::post('index','app/Order/order');
    Route::post('pay','app/Pay/walletPay');
    // 物流
    Route::POST('wuLiu','app/Order/wuLiu');

})->middleware(\api\app\middleware\CheckToken::class);